﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FileDownload.aspx.cs" Inherits="School.SystemManage.WebPages.Download.FileDownload" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <link href="../../css/right.css" rel="stylesheet" type="text/css" />
    <script src="../../../JS/jquery-1.6.1.min.js" type="text/javascript"></script>
    <script src="../../../JS/jquery.MultiFile.js" type="text/javascript"></script>
    <style type="text/css">
        #filelist{ width:60%;}
        #fileUpload{ width:39%;}
        #fileUpload .dataTable .td1{ text-align:right; width:50px; }
        #fileUpload .dataTable .td2{ text-align:left; width:100px; }
        .dataTable input[type=file]{ width:300px;}
        .btnUpload{ background-color:#D3EAEF;}
    </style>
    <script type="text/javascript">
        function CheckAll(checkBoxAll,isInTable) {
            var dataTable = document.getElementById("DataList");
            var checkBoxes = dataTable.getElementsByTagName("INPUT");
            var startIndex = 0;
            if (isInTable) {
                startIndex = 1;
            }
            for (var i = startIndex; i < checkBoxes.length; i++) {
                checkBoxes[i].checked = checkBoxAll.checked;
            }
        }

        function HasCheckedRow() {
            var dataTable = document.getElementById("DataList");
            var checkBoxes = dataTable.getElementsByTagName("INPUT");
            for (var i = 1; i < checkBoxes.length; i++) {
                if (checkBoxes[i].checked)
                    return confirm("确定要删除吗？");
            }
            alert("选择要删除的项");
            return false;
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <div class="title_bg">
            <div class="floatLeft title_text_div">下载中心 > 下载文件列表</div> 
            <ul class="floatRight">
                <li><input id="chk_Total" type="checkbox" class="floatLeft" onclick="CheckAll(this,false);" /><span class="checkAll floatLeft">全选</span><div class="clear"></div></li>
                <li class="delete"><asp:LinkButton ID="lbtnDelete" runat="server" 
                        OnClientClick="return HasCheckedRow();" onclick="lbtnDelete_Click">删除</asp:LinkButton></li>
            </ul>
            <div class="clear"></div>
        </div> 
        <div id="filelist" class="floatLeft">
            <table cellspacing="0" id="DataList" class="dataTable">
                <tr>
                    <th><input id="chk_All" type="checkbox" onclick="CheckAll(this,true);" /></th>
                    <th>类别</th>
                    <th>文件名</th>
                    <th>大小</th>
                    <th>类型</th>
                    <th>附件</th>
                    <th>上传时间</th>
                </tr>
                <asp:Repeater ID="rep_files" runat="server">
                    <ItemTemplate>
                        <tr>
                            <td><asp:CheckBox ID="cbChecked" runat="server" /></td>
                            <td>
                                <asp:HiddenField ID="hfFID" runat="server" Value='<%#Eval("FID") %>' />
                                <%#GetCategoryName(Eval("Cagetory").ToString())%>
                            </td>
                            <td><a href='<%#Eval("FIilePath") %>'><%#Eval("Title") %></a></td>
                            <td><%#Eval("FileSize") %></td>
                            <td><%#Eval("ExtendName") %></td>
                            <td><a href='<%#Eval("AttachmentFilePath") %>'><%#Eval("AttachmentTitle")%></td>
                            <td><%#Eval("UploadTime") %></td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <div>
                <webdiyer:AspNetPager runat="server" ID="AspNetPager1" PageSize="10"                
                    CustomInfoHTML="每页%PageSize%条，%CurrentPageIndex%/%PageCount%页" 
                    FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" 
                    ShowCustomInfoSection="Left" SubmitButtonText="Go" TextAfterPageIndexBox="页"  
                    CustomInfoClass="customInfo" CustomInfoSectionWidth="120"
                    TextBeforePageIndexBox="转到" onpagechanged="AspNetPager1_PageChanged">
                </webdiyer:AspNetPager>
            </div>
            <div><asp:Label ID="lblInfo" runat="server" Text="" CssClass="red"></asp:Label></div>
        </div> 
        <div id="fileUpload" class="floatRight" runat="server">
            <table class="dataTable">
                <tr>
                    <th colspan="2" style="height:20px;">文件上传<span class="red">（单文件最大支持2G）</span></th>
                </tr>
                <tr>
                    <td class="td1">类别：</td>
                    <td class="td2">
                        <asp:DropDownList ID="ddl_Category" runat="server">
                            <asp:ListItem Value="20">教务信息</asp:ListItem>
                            <asp:ListItem Value="21">学工信息</asp:ListItem>
                            <asp:ListItem Value="22">学习资源</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="td1">文件选择：</td>
                    <td class="td2">
                        <%--<asp:FileUpload ID="FileUpload1" runat="server" class="multi" />--%>
                        <input id="File1" type="file" name="File1" />
                    </td>
                </tr>
                <tr>
                    <td class="td1">文件名：</td>
                    <td class="td2">
                        <asp:TextBox ID="txb_Name" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="td1">说明：</td>
                    <td class="td2"><asp:TextBox ID="txb_Remark" runat="server" TextMode="MultiLine" Width="300" Height="50"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="td1">附件：</td>
                    <td class="td2"><input id="File2" type="file" name="File2" /></td>
                </tr>
                <tr>
                    <td class="td1">附件名：</td>
                    <td class="td2"><asp:TextBox ID="txbFileAttachName" runat="server"></asp:TextBox></td>
                <tr>
                    <td colspan="2" class="btnUpload">
                        <asp:Button ID="btnUpload" runat="server" Text="上传" onclick="btnUpload_Click" />
                        <asp:Label ID="lblMsg" runat="server" Text="" CssClass="red"></asp:Label>
                    </td>
                </tr>
            </table>
        </div>
        <div class="clear"></div>
    </div>
    </form>
</body>
</html>
